package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.XiezuMapper;
import com.aidex.biz.domain.Xiezu;
import com.aidex.biz.service.XiezuService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 协助记录Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-12-24
 */
@Service
@Transactional(readOnly = true)
public class XiezuServiceImpl extends BaseServiceImpl<XiezuMapper, Xiezu> implements XiezuService
{
    private static final Logger log = LoggerFactory.getLogger(XiezuServiceImpl.class);

    /**
     * 获取单条数据
     * @param xiezu 协助记录
     * @return 协助记录
     */
    @Override
    public Xiezu get(Xiezu xiezu)
    {
        Xiezu dto = super.get(xiezu);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 协助记录id
     * @return 协助记录
     */
    @Override
    public Xiezu get(String id)
    {
        Xiezu dto = super.get(id);
        return dto;
    }


    /**
     * 查询协助记录列表
     * @param xiezu 协助记录
     * @return 协助记录
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<Xiezu> findList(Xiezu xiezu)
    {
        return super.findList(xiezu);
    }

    /**
     * 分页查询协助记录列表
     * @param xiezu 协助记录
     * @return 协助记录
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<Xiezu> findPage(Xiezu xiezu)
    {
        return super.findPage(xiezu);
    }

    /**
     * 保存协助记录
     * @param xiezu
     * @return 结果
     */
    @Override
    public boolean save(Xiezu xiezu)
    {
        return super.save(xiezu);
    }


    /**
     * 删除协助记录信息
     * @param xiezu
     * @return 结果
     */
    @Override
    public boolean remove(Xiezu xiezu)
    {
        return super.remove(xiezu);
    }

    /**
     * 批量删除协助记录
     * @param ids 需要删除的协助记录ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteXiezuByIds(String[] ids)
    {
        return mapper.deleteXiezuByIds(ids);
    }

    /**
     * 获取最大编号
     * @param xiezu 协助记录
     * @return 结果
     */
    @Override
    public int findMaxSort(Xiezu xiezu)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(xiezu));
    }
}
